package service.Impl;

import dao.WsUserDao;
import entity.UserInfoEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import service.Interface.WsUserInterface;

/**
 * Created by thinkjoy on 2017/8/30.
 */
@Service
public class WsUserImpl implements WsUserInterface {

    @Autowired
    private WsUserDao wsUserDao;

    @Override
    public String findSingleUserInfo(String workerid) {
        try {
            String value=wsUserDao.findSingleUserInfo(workerid);
            return value;
        }catch (Exception e){
            e.printStackTrace();
            return null;
        }
    }

    @Override
    public String findWorkerIDforOpenId(String openid) {
        return wsUserDao.findWorkerIDforOpenId(openid);
    }

    @Override
    public String findOpenIdIsExit(String openid) {
        return wsUserDao.findOpenIdIsExit(openid);
    }

    @Override
    public int saveSingleUserInfo(String openid) {
       int num= wsUserDao.saveSingleUserInfo(openid);
        return num;
    }

    @Override
    public int updateUserForOpenid(String workerid, String openid) {
        int num=wsUserDao.updateUserForOpenid(workerid,openid);
        return num;
    }

    @Override
    public int deleteUserByOpenid(String openid) {
        int num=wsUserDao.deleteUserByOpenid(openid);
        return num;
    }

    @Override
    public int saveAllUserInfo(String workerid, String openid) {
        int num=wsUserDao.saveAllUserInfo(workerid,openid);
        return num;
    }

    @Override
    public UserInfoEntity findUserInfoAll(String workerid, String openid) {
        return wsUserDao.findUserInfoAll(workerid,openid);
    }
}
